AppModule   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 18
dl 0
loc 21
rs 10
c 0
b 0
f 0
1
import { Module, Provider } from '@nestjs/common';
2
import { APP_FILTER, DiscoveryModule } from '@nestjs/core';
3
import { TypeOrmModule } from '@nestjs/typeorm';
4
import { ConfigModule } from '@nestjs/config';
5
import { HomeModule } from './Infrastructure/Home/home.module';
6
import { ProjectModule } from './Infrastructure/Project/project.module';
7
import { CustomerModule } from './Infrastructure/Customer/customer.module';
8
import { TaskModule } from './Infrastructure/Task/task.module';
9
import { FairCalendarModule } from './Infrastructure/FairCalendar/faircalendar.module';
10
import { HumanResourceModule } from './Infrastructure/HumanResource/humanResource.module';
11
import { SettingsModule } from './Infrastructure/Settings/settings.module';
12
import { UnexpectedErrorFilter } from './Infrastructure/Common/ExceptionFilter/UnexpectedErrorFilter';
13
import { AuthRequiredFilter } from './Infrastructure/Common/ExceptionFilter/AuthRequiredFilter';
14
import { dataSourceOptions } from './datasource';
15
import { ExtendedRoutingModule } from './Infrastructure/Common/ExtendedRouting/extendedRouting.module';
16
import { NotificationModule } from './Infrastructure/Notification/notification.module';
17
18
const providers: Provider[] = [];
19
20
if (process.env.NODE_ENV !== 'production') {
21
  providers.push({
22
    provide: APP_FILTER,
23
    useClass: UnexpectedErrorFilter
24
  });
25
}
26
27
providers.push({
28
  provide: APP_FILTER,
29
  useClass: AuthRequiredFilter
30
});
31
32
@Module({
33
  imports: [
34
    DiscoveryModule,
35
    TypeOrmModule.forRoot(dataSourceOptions),
36
    ConfigModule.forRoot({
37
      envFilePath: ['.env.local', '.env']
38
    }),
39
    NotificationModule,
40
    HomeModule,
41
    CustomerModule,
42
    FairCalendarModule,
43
    HumanResourceModule,
44
    ProjectModule,
45
    TaskModule,
46
    SettingsModule,
47
    ExtendedRoutingModule
48
  ],
49
  providers
50
})
51
export class AppModule {}
52